#!/usr/bin/python
import os

class GZipCompressor:
	def __commandTemplate(self, string, command):
		argsDict = {}
		argsDict["infile"] = "/tmp/sometempinfile"
		argsDict["outfile"] = "/tmp/sometempoutfile"
		
		open(in_f,"w+").write(string)
		os.system(command % argsDict)
		return open(out_f).read()
	
	def compress(self, string):
		return self.__commandTemplate(string, "gzip -c %(infile)s > %(outfile)s")
	
	def decompress(self, string):
		return self.__commandTemplate(string, "gunzip -c %(infile)s > %(outfile)s")